package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.StrategyCatalog;
import cn.wolfcode.luowowo.article.mapper.StrategyCatalogMapper;
import cn.wolfcode.luowowo.article.service.IStrategyCatalogService;
import cn.wolfcode.luowowo.common.query.QueryObject;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class StrategyCatalogServiceImpl implements IStrategyCatalogService {
    @Autowired
    private StrategyCatalogMapper catalogMapper;
    @Override
    public PageInfo query(QueryObject qo) {
        PageHelper.startPage(qo.getCurrentPage(), qo.getPageSize());
        return new PageInfo(catalogMapper.selectForList(qo));
    }

    @Override
    public List<StrategyCatalog> selectAll() {
        return catalogMapper.selectAll();
    }

    @Override
    public List<StrategyCatalog> selectContainDetailByDestId(Long id) {

        return catalogMapper.selectContainDetailByDestId(id);
    }

    @Override
    public StrategyCatalog selectContainDetailById(Long catalogId) {
        return catalogMapper.selectByPrimaryKey(catalogId);
    }
}
